﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="InventoryFilter.ascx.cs" Inherits="InventoryFilter" %>

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<table>
    <tr>
        <td valign="top" style="width: 348px">
            <table style="width: 350px">
                <tr >
                    <td style="width: 451px">
                        库存：</td>
                </tr>
                <tr>
                    <td style="width: 451px; height: 22px;">
                        <asp:CheckBox ID="cbIsLowerThanMin" runat="server" Text="小于库存下限的图书" /></td>
                </tr>
                <tr>
                    <td style="width: 451px">
                        <asp:CheckBox ID="cbClassA" runat="server" Text="A类" />
                        <asp:CheckBox ID="cbClassB" runat="server" Text="B类" />
                        <asp:CheckBox ID="cbClassC" runat="server" Text="C类" /></td>
                </tr>
                <tr>
                    <td style="width: 451px">库存量介于<asp:TextBox ID="txtMin" runat="server" Width="30px"></asp:TextBox>
                    与
                    <asp:TextBox ID="txtMax" runat="server" Width="30px"></asp:TextBox>之间</td>
                </tr>

            </table>
        </td>
        <td valign="top" align="center">
            <table>
                <tr>
                    <td style="width: 350px">
                        销量：</td>
                </tr>
                <tr>
                    <td style="width: 350px">
                        上月销量大于<asp:TextBox ID="LastMonth" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 350px; height: 26px;">
                        本月预测销量相比上月销量增长<asp:TextBox ID="Growth" runat="server" Width="49px"></asp:TextBox>%以上</td>
                </tr>
            </table>
            </td>
    </tr>
    <tr>
        <td style="width: 348px">
            <table>
                <tr>
                    <td style="width: 449px">
                        补货量
                    </td>
                </tr>
                <tr>
                    <td style="width: 449px">
                        <asp:CheckBox ID="cbAmout" runat="server" Text="以(最大库存量—现有库存)作为补货量" Checked="True" /></td>
                </tr>
                <tr>
                    <td style="width: 449px; height: 26px;">
                        <asp:CheckBox ID="CheckBox2" runat="server" />过滤补货量小于<asp:TextBox ID="TextBox3" runat="server"
                            Width="30px"></asp:TextBox>的记录</td>
                </tr>
            </table>
        </td>
        <td align="center">    
            <asp:Button ID="Button1" runat="server" Text="查看" Height="34px" Width="100px" OnClick="Button1_Click" /></td>
    </tr>
</table>
选择分店:<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="ObjectDataSource3" DataTextField="Name" DataValueField="StoreID" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>
<asp:ObjectDataSource ID="ObjectDataSource3" runat="server" DeleteMethod="Delete"
    InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="FetchAll"
    TypeName="BookShop.StoreController" UpdateMethod="Update">
    <DeleteParameters>
        <asp:Parameter Name="StoreID" Type="Object" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:Parameter Name="StoreID" Type="String" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="Type" Type="String" />
        <asp:Parameter Name="RegionID" Type="Int32" />
        <asp:Parameter Name="Addresss" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
    </UpdateParameters>
    <InsertParameters>
        <asp:Parameter Name="StoreID" Type="String" />
        <asp:Parameter Name="Name" Type="String" />
        <asp:Parameter Name="Type" Type="String" />
        <asp:Parameter Name="RegionID" Type="Int32" />
        <asp:Parameter Name="Addresss" Type="String" />
        <asp:Parameter Name="Phone" Type="String" />
    </InsertParameters>
</asp:ObjectDataSource>
<asp:HiddenField ID="HiddenField1" runat="server" />
&nbsp;
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None">
    <Columns>
        <asp:BoundField DataField="Isbn" HeaderText="ISBN" SortExpression="Isbn" />
        <asp:BoundField DataField="BookName" HeaderText="书名" SortExpression="BookName" />
        <asp:BoundField DataField="Amount" HeaderText="库存" SortExpression="Amount" /> 
        <asp:BoundField DataField="MinStock" HeaderText="库存下限" SortExpression="MinStock" />
        <asp:BoundField DataField="MaxStock" HeaderText="库存上限" SortExpression="MaxStock" />
        <asp:BoundField DataField="LastMonthSale" HeaderText="上月销量" SortExpression="LastMonthSale" />
        <asp:BoundField DataField="Forecast1" HeaderText="第一月预测" SortExpression="Forecast1" />
        <asp:BoundField DataField="Forecast2" HeaderText="第二月预测" SortExpression="Forecast2" />
        <asp:BoundField DataField="Forecast3" HeaderText="第三月预测" SortExpression="Forecast3" />
        <asp:BoundField DataField="Classification" HeaderText="分类" SortExpression="Classification" />
        <asp:ButtonField ButtonType="Button" CommandName="Select" Text="添加" />
    </Columns>
    <FooterStyle BackColor="Tan" />
    <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
    <HeaderStyle BackColor="Tan" Font-Bold="True" />
    <AlternatingRowStyle BackColor="PaleGoldenrod" />
</asp:GridView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
    SelectMethod="Load" TypeName="BookShop.OrderPrediction4StoreCollection"></asp:ObjectDataSource>
    </ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:GridView ID="GridView2" runat="server" DataSourceID="ObjectDataSource2" DataKeyNames="AllocationDetailID" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" >
            <Columns>
                <asp:BoundField DataField="AllocationDetailID" HeaderText="AllocationDetailID" SortExpression="AllocationDetailID"
                    Visible="False" />
                <asp:BoundField DataField="ISBN" HeaderText="ISBN" ReadOnly="True" SortExpression="ISBN" />
                <asp:BoundField DataField="StoreID" HeaderText="分店" ReadOnly="True" SortExpression="StoreID" />
                <asp:BoundField DataField="Amount" HeaderText="补货量" SortExpression="Amount" />
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            </Columns>
            <FooterStyle BackColor="Tan" />
            <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
            <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
            <HeaderStyle BackColor="Tan" Font-Bold="True" />
            <AlternatingRowStyle BackColor="PaleGoldenrod" />
            
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" DeleteMethod="Destroy"
            InsertMethod="Insert" SelectMethod="FetchByAllocationID"
            TypeName="BookShop.AllocationDetailController" UpdateMethod="Update">
            <SelectParameters>
                <asp:ControlParameter ControlID="HiddenField1" Name="AllocationID" PropertyName="Value"
                    Type="Object" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="AllocationDetailID" Type="Object" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="AllocationDetailID" Type="Int32" />
                <asp:Parameter Name="AllocationID" Type="String" />
                <asp:Parameter Name="Isbn" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="StoreID" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="AllocationID" Type="String" />
                <asp:Parameter Name="Isbn" Type="String" />
                <asp:Parameter Name="Amount" Type="Int32" />
                <asp:Parameter Name="StoreID" Type="String" />
            </InsertParameters>
            
        </asp:ObjectDataSource>
    </ContentTemplate>
</asp:UpdatePanel>
&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="生成补货单" />
